package ds;


public class MySearch {
    public static boolean contains(int[] arr, int size, int val) {
        int l = 0, r = size - 1;
        while (l <= r) {
            int m = l + (r - l) / 2;
            if (arr[m] == val) return true;
            if (arr[m] < val) r = m - 1;
            else l = m + 1;
        }
        return false;
    }
} 